<template>
  <!-- `checked` 为 true 或 false -->
  <el-checkbox v-model="checked" @change="Radiochange()" style="display: inline; "  ></el-checkbox>
</template>
<script>
  export default {
    data() {
      return {
        checked: false,
		ObjectPath:"/Game/Maps/LaserStage.LaserStage:PersistentLevel.PostProcessVolume_1",
		names:[
			"bOverride_WhiteTemp",
			"bOverride_WhiteTint",
			"bOverride_ColorSaturation",
			"bOverride_ColorContrast",
			"bOverride_ColorGamma",
			"bOverride_ColorGain" ,
			"bOverride_ColorOffset",
			"bOverride_ColorSaturationShadows",
			"bOverride_ColorContrastShadows",
			"bOverride_ColorGammaShadows",
			"bOverride_ColorGainShadows",
			"bOverride_ColorOffsetShadows",
			"bOverride_ColorSaturationMidtones",
			"bOverride_ColorContrastMidtones",
			"bOverride_ColorGammaMidtones",
			"bOverride_ColorGainMidtones",
			"bOverride_ColorOffsetMidtones",
			"bOverride_ColorSaturationHighlights",
			"bOverride_ColorContrastHighlights",
			"bOverride_ColorGammaHighlights",
			"bOverride_ColorGainHighlights",
			"bOverride_ColorOffsetHighlights",
			"bOverride_ColorCorrectionShadowsMax",
			"bOverride_ColorCorrectionHighlightsMin",
			"bOverride_BlueCorrection",
			"bOverride_ExpandGamut",
			"bOverride_ToneCurveAmount",
			"bOverride_FilmSlope",
			"bOverride_FilmToe",
			"bOverride_FilmShoulder",
			"bOverride_FilmBlackClip",
			"bOverride_FilmWhiteClip",
			"bOverride_SceneColorTint",
			"bOverride_ColorGradingIntensity",
			"bOverride_ColorGradingLUT",		
		],
		text:'PostProcessVolume',
      };
    },
	props:[
		'nameProp','objpath'
	],
	methods:{
		
		Radiochange(){
		// this.ObjectPath=this.objpath
		let name,Arayy,updataname;
		// let testname=this.nameProp
		for(let i in this.names){
			Arayy=this.names
			name=Arayy[i].match(this.nameProp)
			// console.log(name)
			if(name != null){
				// console.log(name)
				if(name == "ColorSaturation"){
					updataname="bOverride_ColorSaturation"
				}else if(name == "ColorContrast"){
					updataname="bOverride_ColorContrast"
				}else if(name == "ColorGamma"){
					updataname="bOverride_ColorGamma"
				}else if(name == "ColorGain"){
					updataname="bOverride_ColorGain"
				}else if(name == "ColorOffset"){
					updataname="bOverride_ColorOffset"
				}else{
					updataname=name.input
				}
				
				
			}
		}
			// this.objpath
		// console.log(this.nameProp,"11111111111111")
		
				console.log(this.objpath,"1111111111133111")
		let json ={}
		
			json[updataname]=this.checked
		
		
		 console.log(this.objpath,this.ObjectPath)
									this.axios.put('/remote/object/property',
				{
						"objectPath" :this.objpath,
							"access" :"WRITE_TRANSACTION_ACCESS",
							"propertyName" :"Settings",
							"propertyValue" :{
								"Settings":json
							}
							
								 
					
				},
				{
					headers:{
						'Content-Type': 'application/json'
					}
				}
				
				
				).then((res) =>{
					// console.log(json)
					
				},
				(err)=>{
					
				}
				)
								
				
			
			
		},
		
	}
	
	
  };
</script>
